package com.dzm.manager.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;

/**
 * 作者：Dzm
 * 时间：2024-09-18-9:56
 * 功能：
 */

@Configuration
@EnableRedisHttpSession
public class DxgSessionConfig {

    @Bean
    public CookieSerializer cookieSerializer() {
        DefaultCookieSerializer serializer = new DefaultCookieSerializer();
        serializer.setCookieName("DXG_SESSION");
        serializer.setCookiePath("/");
        serializer.setDomainName("daxigua.com");    //所有以daxigua.com为一级域名的二级域名都能进行session共享
        return serializer;
    }
}
